package com.igeekhome.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.igeekhome.biz.IBlackListService;
import com.igeekhome.biz.ICustomerServiceService;
import com.igeekhome.pojo.BlackList;
import com.igeekhome.pojo.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 恶意用户列表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-03-16
 */
@Controller
@RequestMapping("/blackList")
public class BlackListController {
    @Autowired
    private IBlackListService iBlackListService;
    @Autowired
    private ICustomerServiceService iCustomerServiceService;
    @RequestMapping("/Blacklist")
    public String CSUpdate(Model model, BlackList bl,  Integer current, Integer size) {

        this.iBlackListService.removeById(bl);
        IPage<BlackList> page = new Page<>(current, size);
        IPage<BlackList> page1 = this.iBlackListService.page(page);
        List<BlackList> list = page1.getRecords();
        long pagesCount = page1.getPages();
        model.addAttribute("list", list);
        model.addAttribute("pagesCount", pagesCount);
        model.addAttribute("current", current);
        model.addAttribute("size", size);
        return "Blacklist";
    }


}

